package com.ssy.lingxi.pay.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 授信账单
 * @author 伍将
 * @date 2020/8/21
 * @version 2.0.0
 */
@Entity
@Table(schema = "public", name = "pay_credit_bill",
        indexes = {@Index(name = "pay_credit_bill_credit_id_idx", columnList = "creditId"),
                @Index(name = "pay_credit_bill_bill_day_idx", columnList = "billDay"),
                @Index(name = "pay_credit_bill_bill_belong_time_idx", columnList = "billBelongTime"),
                @Index(name = "pay_credit_bill_expire_time_idx", columnList = "expireTime")})
public class CreditBillDO implements Serializable {
    private static final long serialVersionUID = 7554508995935361847L;

    public CreditBillDO() {
        this.creditId = 0L;
        this.billBelongTime = 0L;
        this.billQuota = 0D;
        this.repayQuota = 0D;
        this.waitConfirmRepayQuota = 0D;
        this.refundQuota = 0D;
        this.lastRepayDate = 0L;
        this.lastRepayQuota = 0D;
        this.payOffDate = 0L;
        this.createTime = System.currentTimeMillis();
        this.updateTime = 0L;
        this.billDay = 0;
        this.repayPeriod = 0;
        this.expireTime = 0L;
    }

    /**
     * 账单id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "credit_bill_seq")
    @SequenceGenerator(sequenceName = "pay_credit_bill_seq", name = "credit_bill_seq", allocationSize = 1)
    private Long id;

    /**
     * 授信id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long creditId;

    /**
     * 账单所属时间（格式：当月第一天时间戳）
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long billBelongTime;

    /**
     * 账单额度
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private Double billQuota;

    /**
     * 偿还额度
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private Double repayQuota;

    /**
     * 待确认偿还额度
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private Double waitConfirmRepayQuota;

    /**
     * 退款额度
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private Double refundQuota;

    /**
     * 账单日期
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer billDay;

    /**
     * 还款周期
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer repayPeriod;

    /**
     * 到期日期
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long expireTime;

    /**
     * 最后还款日期
     */
    @Column(columnDefinition = "int8")
    private Long lastRepayDate;

    /**
     * 最后还款额度
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private Double lastRepayQuota;

    /**
     * 还清日期
     */
    @Column(columnDefinition = "int8")
    private Long payOffDate;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long createTime;

    /**
     * 更新时间
     */
    @Column(columnDefinition = "int8")
    private Long updateTime;

    public Double getRefundQuota() {
        return refundQuota;
    }

    public void setRefundQuota(Double refundQuota) {
        this.refundQuota = refundQuota;
    }

    public Long getBillBelongTime() {
        return billBelongTime;
    }

    public void setBillBelongTime(Long billBelongTime) {
        this.billBelongTime = billBelongTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCreditId() {
        return creditId;
    }

    public void setCreditId(Long creditId) {
        this.creditId = creditId;
    }


    public Double getBillQuota() {
        return billQuota;
    }

    public void setBillQuota(Double billQuota) {
        this.billQuota = billQuota;
    }

    public Double getRepayQuota() {
        return repayQuota;
    }

    public void setRepayQuota(Double repayQuota) {
        this.repayQuota = repayQuota;
    }

    public Double getWaitConfirmRepayQuota() {
        return waitConfirmRepayQuota;
    }

    public void setWaitConfirmRepayQuota(Double waitConfirmRepayQuota) {
        this.waitConfirmRepayQuota = waitConfirmRepayQuota;
    }

    public Integer getBillDay() {
        return billDay;
    }

    public void setBillDay(Integer billDay) {
        this.billDay = billDay;
    }

    public Integer getRepayPeriod() {
        return repayPeriod;
    }

    public void setRepayPeriod(Integer repayPeriod) {
        this.repayPeriod = repayPeriod;
    }

    public Long getLastRepayDate() {
        return lastRepayDate;
    }

    public void setLastRepayDate(Long lastRepayDate) {
        this.lastRepayDate = lastRepayDate;
    }

    public Double getLastRepayQuota() {
        return lastRepayQuota;
    }

    public void setLastRepayQuota(Double lastRepayQuota) {
        this.lastRepayQuota = lastRepayQuota;
    }

    public Long getPayOffDate() {
        return payOffDate;
    }

    public void setPayOffDate(Long payOffDate) {
        this.payOffDate = payOffDate;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public Long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Long expireTime) {
        this.expireTime = expireTime;
    }
}
